<?php
session_start ();

// Connect to the database
require_once ("../../../db.php");
// Only allow this for employee users
if (!isset($_SESSION['uid']) || ($_SESSION['type'] != 'employee'))
    die('Not logged in as an employee user');

// Select the comment that any employee can see
$sql = 'SELECT collegiumComments, status FROM projects WHERE id=' . $_POST['pid'];
$sth = $db->prepare($sql);
$sth->execute();
$row = $sth->fetchAll();
if($row) {
    echo json_encode($row);
} else {
    echo json_encode(array('error' => 'Ingen kommentarer funnet'));
}

?>
